package com.mylib.libcore.utils;

/**
 * @author Administrator
 * @date 2020/3/25-17:28
 * @description
 **/
public class MyStringUtils {
    /**
     * long-progress转时分
     * @param progress
     * @return
     */
    private static int HOUR_TIME  = 60*60*1000;
    private static int MIN_TIME  = 60*1000;
    private static int SEC_TIME  = 1000;
    public static String progressToTimeString(int progress){
        int hour = progress/HOUR_TIME;
        int min = progress%HOUR_TIME/MIN_TIME;
        int sec = progress%MIN_TIME/SEC_TIME;
        String timeString = "00:00";
        if(hour==0){
            timeString = String.format("%02d:%02d",min,sec);
        }else {
            timeString = String.format("%02d:%02d:%02d",hour,min,sec);
        }
        return timeString;
    }
}
